﻿@{
    ViewBag.Title = "Add";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}




@section Header{

    <script type="text/javascript">



        function submit() {
            //编辑器对象
            var uEditor = UE.getEditor('txt_Review');

            //验证输入
            if ($("#txt_Title").validatebox('isValid') == false) { return; }
            if ($("#txt_Reviewer").validatebox('isValid') == false) { return; }

            if (uEditor.hasContents() == false) {
                $.messager.alert('失败', '请输入内容', 'error');
                return;
            }



            //参数对象
            var review= {
                Title: $("#txt_Title").val(),
                Reviewer: $("#txt_Reviewer").val(),
                ArtWorkReview: uEditor.getContent()
            };

            $.post("/ArtWorkReview/AddArtWorkReview/", review,
                    function (data, textStatus) {
                        if (data == 'success') {
                            $("#txt_Title").val(""); //清空
                            $("#txt_Reviewer").val(""); //清空
                            uEditor.setContent(""); //清空
                            $('#AttarchmentDIV').empty();

                            $.messager.alert('成功', '添加成功', 'info');
                        }
                        else { $.messager.alert('失败', data, 'error'); }
                    }
            );
        }
    </script>
}

<body>

    <div>
        标题:
        @Html.TextBox("txt_Title", "", new { size = 50, @class = "easyui-validatebox", required = "true" })
        <br />
        评论人:
        @Html.TextBox("txt_Reviewer", "", new { size = 45, @class = "easyui-validatebox", required = "true" })
        <br />
        @Html.UEditor("txt_Review")
        <br />

        <p>
            <input type="button" value="添加" onclick="submit()" />
        </p>
    </div>
</body>
